package com.beimin.evedata.model.map;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.beimin.evedata.model.chr.ChrFaction;

@Entity
@Table(name = "mapconstellations")
public class MapConstellation implements java.io.Serializable {
	private int constellationId;
	private ChrFaction faction;
	private MapConstellation constellation;
	private Integer regionId;
	private String constellationName;
	private Double x;
	private Double y;
	private Double z;
	private Double xmin;
	private Double xmax;
	private Double ymin;
	private Double ymax;
	private Double zmin;
	private Double zmax;
	private Double radius;
	private Set<MapSolarSystemJump> mapsolarsystemjumpsesForToConstellationId = new HashSet<MapSolarSystemJump>(0);
	private Set<MapConstellationJump> mapconstellationjumpsesForFromConstellationId = new HashSet<MapConstellationJump>(0);
	private Set<MapConstellationJump> mapconstellationjumpsesForToConstellationId = new HashSet<MapConstellationJump>(0);
	private Set<MapSolarSystem> solarsystems = new HashSet<MapSolarSystem>(0);
	private Set<MapConstellation> constellations = new HashSet<MapConstellation>(0);
	private Set<MapSolarSystemJump> mapsolarsystemjumpsesForFromConstellationId = new HashSet<MapSolarSystemJump>(0);

	public MapConstellation() {
	}

	public MapConstellation(int constellationId, MapConstellation constellation) {
		this.constellationId = constellationId;
		this.constellation = constellation;
	}

	public MapConstellation(int constellationId, ChrFaction faction, MapConstellation constellation, Integer regionId, String constellationName, Double x, Double y,
			Double z, Double xmin, Double xmax, Double ymin, Double ymax, Double zmin, Double zmax, Double radius, Date graceDateTime,
			Set<MapSolarSystemJump> mapsolarsystemjumpsesForToConstellationId, Set<MapConstellationJump> mapconstellationjumpsesForFromConstellationId,
			Set<MapConstellationJump> mapconstellationjumpsesForToConstellationId, Set<MapSolarSystem> solarsystems, Set<MapConstellation> constellations,
			Set<MapSolarSystemJump> mapsolarsystemjumpsesForFromConstellationId) {
		this.constellationId = constellationId;
		this.faction = faction;
		this.constellation = constellation;
		this.regionId = regionId;
		this.constellationName = constellationName;
		this.x = x;
		this.y = y;
		this.z = z;
		this.xmin = xmin;
		this.xmax = xmax;
		this.ymin = ymin;
		this.ymax = ymax;
		this.zmin = zmin;
		this.zmax = zmax;
		this.radius = radius;
		this.mapsolarsystemjumpsesForToConstellationId = mapsolarsystemjumpsesForToConstellationId;
		this.mapconstellationjumpsesForFromConstellationId = mapconstellationjumpsesForFromConstellationId;
		this.mapconstellationjumpsesForToConstellationId = mapconstellationjumpsesForToConstellationId;
		this.solarsystems = solarsystems;
		this.constellations = constellations;
		this.mapsolarsystemjumpsesForFromConstellationId = mapsolarsystemjumpsesForFromConstellationId;
	}

	@Id
	@Column(name = "constellationID", unique = true, nullable = false)
	public int getConstellationId() {
		return this.constellationId;
	}

	public void setConstellationId(int constellationId) {
		this.constellationId = constellationId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "factionID")
	public ChrFaction getFaction() {
		return this.faction;
	}

	public void setFaction(ChrFaction faction) {
		this.faction = faction;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "constellationID", unique = true, nullable = false, insertable = false, updatable = false)
	public MapConstellation getConstellation() {
		return this.constellation;
	}

	public void setConstellation(MapConstellation constellation) {
		this.constellation = constellation;
	}

	@Column(name = "regionID")
	public Integer getRegionId() {
		return this.regionId;
	}

	public void setRegionId(Integer regionId) {
		this.regionId = regionId;
	}

	@Column(name = "constellationName", length = 100)
	public String getConstellationName() {
		return this.constellationName;
	}

	public void setConstellationName(String constellationName) {
		this.constellationName = constellationName;
	}

	@Column(name = "x", precision = 22, scale = 0)
	public Double getX() {
		return this.x;
	}

	public void setX(Double x) {
		this.x = x;
	}

	@Column(name = "y", precision = 22, scale = 0)
	public Double getY() {
		return this.y;
	}

	public void setY(Double y) {
		this.y = y;
	}

	@Column(name = "z", precision = 22, scale = 0)
	public Double getZ() {
		return this.z;
	}

	public void setZ(Double z) {
		this.z = z;
	}

	@Column(name = "xMin", precision = 22, scale = 0)
	public Double getXmin() {
		return this.xmin;
	}

	public void setXmin(Double xmin) {
		this.xmin = xmin;
	}

	@Column(name = "xMax", precision = 22, scale = 0)
	public Double getXmax() {
		return this.xmax;
	}

	public void setXmax(Double xmax) {
		this.xmax = xmax;
	}

	@Column(name = "yMin", precision = 22, scale = 0)
	public Double getYmin() {
		return this.ymin;
	}

	public void setYmin(Double ymin) {
		this.ymin = ymin;
	}

	@Column(name = "yMax", precision = 22, scale = 0)
	public Double getYmax() {
		return this.ymax;
	}

	public void setYmax(Double ymax) {
		this.ymax = ymax;
	}

	@Column(name = "zMin", precision = 22, scale = 0)
	public Double getZmin() {
		return this.zmin;
	}

	public void setZmin(Double zmin) {
		this.zmin = zmin;
	}

	@Column(name = "zMax", precision = 22, scale = 0)
	public Double getZmax() {
		return this.zmax;
	}

	public void setZmax(Double zmax) {
		this.zmax = zmax;
	}

	@Column(name = "radius", precision = 22, scale = 0)
	public Double getRadius() {
		return this.radius;
	}

	public void setRadius(Double radius) {
		this.radius = radius;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mapconstellationsByToConstellationId")
	public Set<MapSolarSystemJump> getMapsolarsystemjumpsesForToConstellationId() {
		return this.mapsolarsystemjumpsesForToConstellationId;
	}

	public void setMapsolarsystemjumpsesForToConstellationId(Set<MapSolarSystemJump> mapsolarsystemjumpsesForToConstellationId) {
		this.mapsolarsystemjumpsesForToConstellationId = mapsolarsystemjumpsesForToConstellationId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mapconstellationsByFromConstellationId")
	public Set<MapConstellationJump> getMapconstellationjumpsesForFromConstellationId() {
		return this.mapconstellationjumpsesForFromConstellationId;
	}

	public void setMapconstellationjumpsesForFromConstellationId(Set<MapConstellationJump> mapconstellationjumpsesForFromConstellationId) {
		this.mapconstellationjumpsesForFromConstellationId = mapconstellationjumpsesForFromConstellationId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mapconstellationsByToConstellationId")
	public Set<MapConstellationJump> getMapconstellationjumpsesForToConstellationId() {
		return this.mapconstellationjumpsesForToConstellationId;
	}

	public void setMapconstellationjumpsesForToConstellationId(Set<MapConstellationJump> mapconstellationjumpsesForToConstellationId) {
		this.mapconstellationjumpsesForToConstellationId = mapconstellationjumpsesForToConstellationId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "constellation")
	public Set<MapSolarSystem> getMapsolarsystemses() {
		return this.solarsystems;
	}

	public void setMapsolarsystemses(Set<MapSolarSystem> mapsolarsystemses) {
		this.solarsystems = mapsolarsystemses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "constellation")
	public Set<MapConstellation> getConstellations() {
		return this.constellations;
	}

	public void setConstellations(Set<MapConstellation> constellations) {
		this.constellations = constellations;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mapconstellationsByFromConstellationId")
	public Set<MapSolarSystemJump> getMapsolarsystemjumpsesForFromConstellationId() {
		return this.mapsolarsystemjumpsesForFromConstellationId;
	}

	public void setMapsolarsystemjumpsesForFromConstellationId(Set<MapSolarSystemJump> mapsolarsystemjumpsesForFromConstellationId) {
		this.mapsolarsystemjumpsesForFromConstellationId = mapsolarsystemjumpsesForFromConstellationId;
	}

}
